//
//  HomeVideoTableViewCell.swift
//  OnceNectar
//
//  Created by 法正磊 on 2018/1/31.
//  Copyright © 2018年 com.inwhoop. All rights reserved.
//

import UIKit

class HomeVideoTableViewCell: UITableViewCell, BottomShadow, AddCornerUIRectCorner {
    @IBOutlet weak var mainView: UIView!
    
    @IBOutlet weak var showImageView: UIImageView!
    
    @IBOutlet weak var titleNameLabel: UILabel!
    @IBOutlet weak var introductionLabel: UILabel!
    @IBOutlet weak var imageViewHeight: NSLayoutConstraint!
    override func awakeFromNib() {
        super.awakeFromNib()
        imageViewHeight.constant = kHeight(r: imageViewHeight.constant)
        setShadow(view: mainView, opacity: bottomShadowOpacity, size: bottomShadowOffset, color: UIColor.black, cornerradius: CORNERRADIUS)
        addCornerWithView(aView: showImageView, aCorners: [.topLeft, .topRight], aSize: CGSize(width: CORNERRADIUS, height: CORNERRADIUS))
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
    }
    
    func showData(model: VideoModel) {
        introductionLabel.text = model.summary!
        
        showImageView.kf.setImage(with: nil, placeholder: UIImage(named: "djt.jpg"))
        titleNameLabel.text = model.title!
    }
    

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
